package games.gong.durid.entity;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Null;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Role {
    @Null(message = "角色ID必须为空")
    private Long id;

    @NotBlank(message = "角色名不能为空")
    private String name;

    private String description;

    private LocalDateTime createTime;

    private LocalDateTime updateTime;
    // 角色拥有的权限（通过 role_permission 查询）
    private List<Permission> permissions;
    // Constructors

    public Role(Long id, String name, String description) {
        this.id = id;
        this.name = name;
        this.description = description;
    }

}